package com.kb.enums;

public enum FieldEnum {
    KEY0("key0", "产品型号"),
    KEY1("key1", "厂商"),
    KEY2("key2", "产品手册名称"),
    KEY3("key3", "原厂链接"),
    KEY4("key4", "标准符号名"),
    KEY5("key5", "标准封装名"),
    KEY6("key6", "标准3DModel名"),
    KEY7("key7", "描述"),
    KEY8("key8", "描述"),
    KEY9("key9", "库存"),
    KEY10("key10", "价格"),
    KEY11("key11", "包装"),
    KEY12("key12", "系列"),
    KEY13("key13", "产品状态"),
    KEY14("key14", "输出隔离"),
    KEY15("key15", "内部开关"),
    KEY16("key16", "电压 - 击穿"),
    KEY17("key17", "拓扑"),
    KEY18("key18", "电压 - 供电 (Vcc/Vdd)"),
    KEY19("key19", "占空比"),
    KEY20("key20", "频率 - 开关"),
    KEY21("key21", "功率 (W)"),
    KEY22("key22", "故障保护"),
    KEY23("key23", "控制特性"),
    KEY24("key24", "工作温度"),
    KEY25("key25", "供应商器件封装"),
    KEY26("key26", "安装类型"),
    KEY27("key27", "电压 - 启动"),
    KEY28("key28", "等级"),
    KEY29("key29", "资质"),
    KEY30("key30", "冗余"),
    KEY31("key31", "封装类型");

    private final String key;
    private final String name;

    FieldEnum(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public String getKey() {
        return key;
    }

    public String getName() {
        return name;
    }

    // 根据key获取对应的name
    public static String getNameByKey(String key) {
        for (FieldEnum fieldEnum : FieldEnum.values()) {
            if (fieldEnum.getKey().equals(key)) {
                return fieldEnum.getName();
            }
        }
        throw new IllegalArgumentException("Unknown key: " + key);
    }

}